import React from "react";
import cx from "classnames";
import { Modal as AntdModal } from "../../antd/index";
import { Button } from "../index";
import { CloseIcon } from "../Svg";
import "./style/index";
import { ModalProps } from "../../antd/index";
export interface Props extends ModalProps {
  isShowFooterBorder?: boolean;
  children?: React.ReactNode;
}

function Modal(props: Props) {
  const { isShowFooterBorder, className, ...modalProps } = props;
  const antdProps = {
    closeIcon: <CloseIcon />,
    footer: [
      <Button onClick={props.onCancel}>取消</Button>,
      <Button type="primary" onClick={props.onOk}>
        确认
      </Button>,
    ],
    ...modalProps,
  };
  return <AntdModal {...antdProps} className={cx({ "ant-modal-box": !isShowFooterBorder }, className)} />;
}

export default Modal;
